﻿<div ng-controller="appraisalTempletController">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                    </div>
                    <h4 class="panel-title">交易评价模板管理</h4>
                </div>
                <div class="panel-body">
                    <div class="form-inline filter-option">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="pull-right">
                                    <span>
                                        <input type="radio" name="star"  value="" ng-checked="true" ng-model="filter.starType" ng-change="reflash()"> 全部
                                        <input type="radio" name="star"  value="1" ng-model="filter.starType" ng-change="reflash()"> 1星
                                        <input type="radio" name="star"  value="2" ng-model="filter.starType" ng-change="reflash()"> 2星
                                        <input type="radio" name="star"  value="3" ng-model="filter.starType" ng-change="reflash()"> 3星
                                        <input type="radio" name="star"  value="4" ng-model="filter.starType" ng-change="reflash()"> 4星
                                        <input type="radio" name="star"  value="5" ng-model="filter.starType" ng-change="reflash()"> 5星
                                    </span>
                                    <button class="btn btn-sm btn-info" ng-click="reflash()"><i class="fa fa-search"></i> 筛选</button>
                                    <button class="btn btn-sm btn-success" ng-click="edit()"><i class="fa fa-plus-circle"></i> 新增</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table id="data-table" ng-table="tableParams" template-pagination="template/pagination.html" class="table table-striped table-bordered table-hover table-condensed">
                        <tr ng-repeat="item in $data">
                            <td data-title="'序号'" width="10%" class="text-center">{{ first + $index }}</td>
                            <td data-title="'星级'"  class="text-center">{{ item.star }}星级</td>
                            <td data-title="'描述'"  class="text-center">{{ item.description }}</td>
                            <td class="text-center width-100 text-nowrap">
                                <button class="btn btn-info btn-xs" ng-click="edit(item)"><i class="fa fa-edit"></i> 修改</button>
                                <button class="btn btn-danger btn-xs" ng-click="remove(item)" ><i class="fa fa-remove"></i> 删除</button>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="modal fade" id="modal-edit">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <ng-form name="editForm" novalidate>
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                    <h4 class="modal-title"><i class="fa fa-lg fa-edit text-success"></i>交易评价模板信息<small><font color="red">每一星级至少有一个模板，至多有五个模板</font></small></h4>
                                </div>
                                <div class="modal-body">
                                    <div></div>
                                    <div class="form-horizontal form-inline">
                                        <input type="hidden" ng-model="model.id"/>
                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"><font color="red">*</font> 星级: </label>
                                            <div class="col-md-8">
                                                <select ng-if="model.id==null" class="form-control" ng-model="model.star" >
                                                    <option ng-repeat="s in [1,2,3,4,5]">{{s}}</option>
                                                </select>
                                                <span ng-if="model.id!=null">{{model.star}}</span>星级
                                            </div>
                                        </div>

                                        <div class="form-group width-full">
                                            <label class="col-md-3 control-label"> 描述: </label>
                                            <div class="col-md-8">
                                                <input type="text" name="description" ng-model="model.description" class="form-control width-full" required />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="submit" class="btn btn-sm btn-success" ng-click="save()" ng-disabled="editForm.$invalid"><i class="fa fa-save"></i> 保存</button>
                                    <button type="button" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-share-square-o"></i> 关闭</button>
                                </div>
                            </ng-form>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

